import App from './App'
import io from './common/socket/weapp.socket.io.js'
// #ifndef VUE3
import Vue from 'vue'

import store from 'store';
Vue.prototype.$store = store;
Vue.prototype.socket = io("http://hkzyc28.natapp1.cc");
Vue.config.productionTip = false;

//权限跳转:
Vue.prototype.navigateTo = (options)=>{
	// 判断是否登录
	if(! store.state.user.loginStatus){
		//如果没有登录
		uni.showToast({
			title:"请先登录",
			icon:"none",
			mask:true,
			duration:1500
		})
		//执行跳转到登录页面
		return uni.navigateTo({
			url:'/pages/login/login'
		})
	}
	//如果已经登录: 跳转到options
	uni.navigateTo(options)
}

// Vue.prototype.socket = io("https://zyc618.mynatapp.cc")
App.mpType = 'app'
const app = new Vue({
	store,
  ...App,
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app,
	
  }
}
// #endif